import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:silver_flutter/api.dart' as api;

class LoginPage extends StatefulWidget {
  LoginPage({Key key}) : super(key: key);

  @override
  State<StatefulWidget> createState() {
    return new _LoginPageState();
  }
}

class _LoginPageState extends State<LoginPage> {
  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: AppBar(
        title: Text("登录"),
      ),
      body: new Center(
        child: GestureDetector(
          onTap: () {
            api.weixinLogin().then((_) => Navigator.pop(context));
          },
          child: new Container(
            width: 50.0,
            height: 50.0,
            child: new Image.asset(
              'images/wechat_logo.png',
            ),
          ),
        ),
      ),
    );
  }
}
